---
title: clsTaskPriorityCodeCollection
summary: API reference for clsTaskPriorityCodeCollection.
status: draft
owner: SAIF Documentation
last_reviewed: 2026-08-21
library: SAIF.Business.Tasks
reference_type: embedded
---

# clsTaskPriorityCodeCollection

`clsTaskPriorityCodeCollection` loads all `TASK_PRIORITY_CODE` rows and provides the code↔enum translation and well-known priority-level constants used throughout the task search subsystem's priority filtering.

## Purpose
- Retrieve the full priority-code reference list ([SQL-010](../../sql/SQL-010-select-task-priority-code-list.md)).
- Translate between the database code string and the `TaskPriority` enum in both directions, defaulting unrecognized codes to `Informational` ([BR-025](../../business-rules.md#br-025-unrecognized-codes-map-to-a-safe-default)).
- Expose the well-known priority-level code constants consumed by `clsTaskCollection.Criteria.FormatPriorityParameter` ([BR-018](../../business-rules.md#br-018-a-priority-level-filter-selects-that-priority-and-all-higher-ones)).

## Context
- Namespace: `SAIF.Business.Tasks`
- Assembly/package: `SAIF.Business.Tasks` (embedded in the `LegalMaintenance` web deployment)

## Public members
| Member | Signature | Purpose |
| --- | --- | --- |
| `cInfo`, `cLow`, `cMedium`, `cHigh`, `cUrgent` | `Const cX As String` | Well-known priority-code literals (`INFO`, `LOW`, `MED`, `HIGH`, `URG`) used to build priority-level `IN` predicates ([BR-018](../../business-rules.md#br-018-a-priority-level-filter-selects-that-priority-and-all-higher-ones)). |
| `Priority` | `Shared Function Priority(inCode As String) As TaskPriority` | Translates a database priority code to the `TaskPriority` enum; unrecognized values return `Informational` ([BR-025](../../business-rules.md#br-025-unrecognized-codes-map-to-a-safe-default)). |
| `Priority` | `Shared Function Priority(inPriority As TaskPriority) As String` | Translates a `TaskPriority` enum value back to its database code string. |
| `Item` | `Default ReadOnly Property Item(inPriority As TaskPriority) As clsTaskPriorityCode` | Looks up the loaded code object matching a `TaskPriority` value. |
| `Description` | `ReadOnly Property Description(inPriority As TaskPriority) As String` | Looks up the description string matching a `TaskPriority` value. |
| `GetCodes` | `Shared Function GetCodes(dpi As IDataPortalInfo) As clsTaskPriorityCodeCollection` | Factory/retrieval entry point that loads the entire priority-code table ([SQL-010](../../sql/SQL-010-select-task-priority-code-list.md)). |
| `Criteria` | `Friend Class Criteria` (nested, implements `IBusinessCriteria`) | Read-only criteria for this code table; write-SQL properties throw `ApplicationException(clsConstants.Messages.InvalidSQLProperty)` ([BR-023](../../business-rules.md#br-023-code-tables-are-read-only-reference-data)). |

## Behavioral notes
- The class is `<Serializable()>`, consistent with remoting/session persistence of BOF objects across the web tier*.
- The priority-level constants are consumed by `clsTaskCollection.Criteria.FormatPriorityParameter`, whose `Urgent` branch produces an unbalanced `IN (` clause — a likely defect in the caller, not in this type*.

## Constraints and usage notes
- Any attempt to use `CreateSQL`/`InsertSQL`/`UpdateSQL`/`DeleteSQL` on this type's `Criteria` throws `ApplicationException(clsConstants.Messages.InvalidSQLProperty)` ([BR-023](../../business-rules.md#br-023-code-tables-are-read-only-reference-data)).

> **Note:** Statements marked with * were inferred from code structure, naming conventions, or
> contextual evidence where direct confirmation was not available in source artifacts. Statements
> marked with ** could not be confirmed; treat as unknown until verified.

## Related documentation
- [API index](../index.md)
- [clsTaskPriorityCode](clsTaskPriorityCode.md)
- [Business rules](../../business-rules.md)
- [Operation: Retrieve a filtered task list](../../operations/retrieve-filtered-task-list.md)

## Sources
- SAIF.Business.Tasks/clsTaskPriorityCodeCollection.vb
